package com.design.mode.responsibility;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-06 14:36:35
 */
public class CApproved extends Approved {

    public CApproved(String name) {
        super(name);
    }

    @Override
    public void process(Request request) {
        increment();
        if (request.getPrice() >= 8000) {
            System.out.println(getName() + ": " + request.getId() + "-" + request.getType() + "-" + request.getPrice());
        } else {
            approved.process(request);
        }
    }
}
